home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / msysjour / vol06 / 04 / winstdio / simple2.c < prev    next >
C/C++ Source or Header  |  1991-07-01  |  1KB  |  47 lines

  1. /*
  2. SIMPLE2.C
  3.  
  4. Microsoft C, Windows SDK:
  5. cl -c -AS -Gsw -Oais -Zpe simple2.c winio.c wmhandlr.c
  6. link simple2 winio wmhandlr,simple2,nul,/nod slibcew libw,winio.def
  7. rc winio.rc simple2.exe
  8.  
  9. WINIO.DEF (generic .DEF file for programs built with WINIO):
  10. NAME        winio_app
  11. EXETYPE     WINDOWS
  12. CODE        PRELOAD MOVEABLE DISCARDABLE
  13. DATA        PRELOAD MOVEABLE MULTIPLE
  14. HEAPSIZE    4096
  15. STACKSIZE   8192
  16. EXPORTS     WndProc
  17.  
  18. WINIO.RC (generic .RC file for programs built with WINIO):
  19. winio_icon ICON stdio.ico
  20.  
  21. Borland C++ (no .DEF file needed):
  22. bcc -WS -G -O -Z -w-par -Hu simple2.c winio.c wmhandlr.c
  23. rc winio.rc simple2.exe
  24. */
  25.  
  26. #include "windows.h"
  27. #include "winio.h"
  28.  
  29. int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, 
  30.     LPSTR lpCmdLine, int nCmdShow)
  31. {
  32.     unsigned vers = GetVersion();
  33.     unsigned long flags = GetWinFlags();
  34.     
  35.     winio_settitle("Introduction to WINIO");
  36.     if (! winio_init(hInstance, hPrevInstance, nCmdShow, 0))
  37.         return 1;
  38.     printf("Windows v. %d.%d\n", LOBYTE(vers), HIBYTE(vers));
  39.     printf("%s mode\n", 
  40.         (flags & WF_ENHANCED) ? "Enhanced" :
  41.         (flags & WF_STANDARD) ? "Standard" :
  42.         /* default */           "Real");
  43.     printf("%d tasks running\n", GetNumTasks());
  44.     return 0;
  45. }
  46.  
  47.